package com.example.front.config;

import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import io.jsonwebtoken.Jwts;

import java.util.HashMap;

public class PasswordTokenCache {


    private static TimedCache<String,String> cache = CacheUtil.newTimedCache(360000);

    public static void putToken(String userName,String token){
        cache.put(userName,token, 600000);
    }

    public static void removeToken(String userName){
        cache.remove(userName);
    }

    public static String getTokenByUsername(String username){
        return cache.get(username);
    }
}



